#!/usr/bin/env python
#coding=utf-8
# 使用正则表达是不够健壮，和具有可读性差的缺点
from bs4 import BeautifulSoup
#from html.parser import HTMLParser
broken_html = '<ul class=country><li>Area<li>Popolation</ul>'
soup = BeautifulSoup(broken_html, "html.parser")
fixed_html = soup.prettify()
print fixed_html
